from flask import Flask

route_base = '/test'

# 以当前的文件名flask_demo作为app名
app = Flask(__name__)


@app.route('/')
def hello_world(course_id, is_published):
    print('value of course_id is', course_id)
    print('value of state is', is_published)
    print('type of state is', type(is_published))
    return 'Hello World'


@app.route('/test')
def POST_test_bool(course_id, is_published):
    print('value of course_id is', course_id)
    print('value of state is', is_published)
    print('type of state is', type(is_published))


# __name__ == '__main__' 说明方法的调用发生在当前类，如果是其他模块引用该方法，则该条件不成立
if __name__ == '__main__':
    print(__name__)
    # 全部参数
    app.run("localhost", 8080)
    # 没有参数，默认地址为http://localhost:5000
    # app.run()
